package com.zusmart.core.proxy.support;

import java.lang.reflect.Method;

import com.zusmart.base.util.Assert;
import com.zusmart.core.proxy.ProxyMethod;

public abstract class AbstractProxyMethod implements ProxyMethod {

	protected final Method targetMethod;

	protected AbstractProxyMethod(Method targetMethod) {
		Assert.isNull(targetMethod, "target method must not be null");
		this.targetMethod = targetMethod;
	}

	@Override
	public Method getTargetMethod() {
		return this.targetMethod;
	}

	@Override
	public Object invokeTargetMethod(Object targetInstance) throws Throwable {
		return this.invokeTargetMethod(targetInstance, new Object[0]);
	}

}